/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cl.darksigns.webstat.front.servlets;

import cl.darksigns.webstat.back.dao.WebStatDao;
import cl.darksigns.webstat.back.exception.WebStatException;
import java.io.*;
import java.net.*;


import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

/**
 *
 * @author _ViKtOr
 */
public class WebStatInit extends HttpServlet {
    Logger logger = null;
   
   
    @Override
  public void init(){
        try {
            String log4jProps = System.getProperty("WEBSTATPROPERTIES") + "log4j.properties";
            System.out.println("config log4j: " + log4jProps);
            PropertyConfigurator.configure(log4jProps);
            logger = Logger.getLogger(WebStatInit.class);
            WebStatDao dao = new WebStatDao();
            dao.getNextId();
            logger.info("Application WebStat Started");
        } catch (WebStatException ex) {
            logger.error(ex.getMessage());
        }
  }
    
}
